package com.cskaoyan.mapper;

import com.cskaoyan.bean.entity.Collect;
import com.cskaoyan.bean.entity.CollectExample;
import com.cskaoyan.bean.vo.CollectInfoVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CollectMapper {

    // select count(`id`) from market_collect where `id`= #{valueId}
    int existById(Integer valueId);

    long countByExample(CollectExample example);

    int deleteByExample(CollectExample example);

    int deleteByPrimaryKey(Integer id);

//    int deleteByPrimaryKey2(Integer id);

    int insert(Collect record);

    int insertSelective(Collect record);

    List<Collect> selectByExample(CollectExample example);

    List<CollectInfoVo> selectByExample2(CollectExample example); //自定义

    Collect selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Collect record, @Param("example") CollectExample example);

    int updateByExample(@Param("record") Collect record, @Param("example") CollectExample example);

    int updateByPrimaryKeySelective(Collect record);

    int updateByPrimaryKey(Collect record);

    int deleteByValueId(Integer valueId);

    // 获取收藏的最新商品
    Integer[] selectGoodsIdByUserId(Integer userId);
}